import { configureStore } from '@reduxjs/toolkit';
import rootReduser from './rootReduser';
import { createEpicMiddleware } from 'redux-observable';
import rootEpic from './rootEpic';
const epicMiddleware = createEpicMiddleware();

/**
 * 构建 store
 */
const store = configureStore({
  reducer: rootReduser,
  middleware: (getDefaultMiddleware: Function) => getDefaultMiddleware().concat(epicMiddleware)
});

epicMiddleware.run(rootEpic);
export default store;